package com.example.film.service;

import com.example.film.entity.FilmSchedule;
import com.example.film.mapper.FilmScheduleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Date;
import java.util.List;

@Service
public class FilmScheduleServiceImpl implements FilmScheduleService{

    @Autowired
    private FilmScheduleMapper filmScheduleMapper;

    @Override
    public List<FilmSchedule> findFilmSchedule() {
        return filmScheduleMapper.findFilmSchedule();
    }

    @Override
    public List<FilmSchedule> findFilmScheduleInfo(Integer pageNum, Integer pageSize) {
        int startIndex = (pageNum - 1) * pageSize;
        return filmScheduleMapper.findFilmScheduleInfo(startIndex,pageSize);
    }

    @Override
    public List<FilmSchedule> findFilmScheduleByDate(Date date) {
        return filmScheduleMapper.findFilmScheduleByDate(date);
    }

    @Override
    public List<FilmSchedule> findScheduleInfoByDate(Date date) {
        return filmScheduleMapper.findScheduleInfoByDate(date);
    }

    @Override
    public List<FilmSchedule> findFilmSumSession() {
        return filmScheduleMapper.findFilmSumSession();
    }

    @Override
    public List<FilmSchedule> findTypeSumSession() {
        return filmScheduleMapper.findTypeSumSession();
    }

}
